<ul class="posts">
    {% for post in posts %}
    <li class="post">
        <div class="post-thumbnail">
                <a href="{{ url_for('main.userinfo', username = post.user.username) }}">
                    <img class="img-rounded profile-thumbnail" src="{{ post.user.get_image_url(size = 40) }}">
                </a>
        </div>
        <div class="post-content">
            <div class="post-date">{{ moment().fromTime(post.create_time) }}</div>
            <div class="post-author"><a href="{{ url_for('main.userinfo', username = post.user.username) }}">{{ post.user.username }}</a></div>
            <div class="post-body">{% if post.html %}{{ post.html|safe }} {% else %}{{ post.body }}{% endif %}</div>
            <div class="post-footer">
                {% if current_user == post.user %}
                    <a href="{{ url_for("main.edit_post", id = post.id) }}"><span class="label label-default">编辑</span> </a>
                {% elif current_user.is_administer() %}
                    <a href="{{ url_for("main.edit_post", id = post.id) }}"><span class="label label-danger">编辑</span> </a>
                {% endif %}
                <a href="{{ url_for("main.post", id = post.id) }}"><span class="label label-default">链接</span></a>
                <a href="{{ url_for("main.post", id = post.id) }}#comments"><span class="label label-default">评论({{ post.comments.count() }})</span> </a>
            </div>
        </div>
    </li>
    {% endfor %}
</ul>